<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>dps.utils</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css"></link>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">

<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="center">
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar" align="right" width="100%">
      <table border="0" cellpadding="0" cellspacing="0">
      <tr><th class="navbar" align="center">
        <p class="nomargin">
          <a class="navbar" target="_top" href="http://code.google.com/p/dps-x509/">DPS</a>
      </p></th></tr></table>
    </th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <font size="-1"><b class="breadcrumbs">
        <a href="dps-module.html">Package&nbsp;dps</a> ::
        Module&nbsp;utils
      </b></font></br>
    </td>
    <td><table cellpadding="0" cellspacing="0">
      <tr><td align="right"><font size="-2">[<a href="../private/dps.utils-module.html">show&nbsp;private</a>&nbsp;|&nbsp;hide&nbsp;private]</font></td></tr>
      <tr><td align="right"><font size="-2">[<a href="frames.html"target="_top">frames</a>&nbsp;|&nbsp;<a href="dps.utils-module.html" target="_top">no&nbsp;frames</a>]</font></td></tr>
    </table></td>
</tr></table>

<!-- =========== START OF MODULE DESCRIPTION =========== -->
<h2 class="module">Module dps.utils</h2>


<!-- =========== START OF CLASSES =========== -->
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="summary">
  <th colspan="2">Classes</th></tr>
<tr><td width="15%">
  <b><a href="dps.utils.LogOutputModes-class.html"><code>LogOutputModes</code></a></b></td>
  <td>defines the output formats for logging</td></tr>
</table><br />


<!-- =========== START OF FUNCTION SUMMARY =========== -->
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="summary">
  <th colspan="2">Function Summary</th></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="dps.utils-module.html#assertion" class="summary-sig-name"><code>assertion</code></a>(<span class=summary-sig-arg>test</span>,
          <span class=summary-sig-arg>message</span>)</span></code>
<br />
if test is not true throw</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="dps.utils-module.html#out" class="summary-sig-name"><code>out</code></a>(<span class=summary-sig-arg>s</span>,
          <span class=summary-sig-arg>level</span>)</span></code>
<br />
print to standard out and log</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="dps.utils-module.html#setLogLevel" class="summary-sig-name"><code>setLogLevel</code></a>(<span class=summary-sig-arg>level</span>)</span></code>
<br />
level 0 -&gt; always print.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="dps.utils-module.html#setLogMode" class="summary-sig-name"><code>setLogMode</code></a>(<span class=summary-sig-arg>mode</span>)</span></code>
<br />
set the global log mode</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        string
</font></td>
  <td><code><span class="summary-sig"><a href="dps.utils-module.html#stringify" class="summary-sig-name"><code>stringify</code></a>(<span class=summary-sig-arg>value</span>,
          <span class=summary-sig-arg>defaultIfNull</span>)</span></code>
<br />
attempt to convert string.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        int
</font></td>
  <td><code><span class="summary-sig"><a href="dps.utils-module.html#toInt" class="summary-sig-name"><code>toInt</code></a>(<span class=summary-sig-arg>value</span>)</span></code>
<br />
attempt to convert string to int.</td></tr>
</table><br />


<!-- =========== START OF IMPORTS =========== -->
<dl>
  <dt><b>Imported modules:</b></dt>
  <dd>
    <code>exceptions</code>,
    <code>logging</code>
  </dd>
  <dt><b>Imported variables:</b></dt>
  <dd>
    <code>LOG_LEVEL</code>,
    <code>LOG_MODE</code>
  </dd>
</dl>


<!-- =========== START OF FUNCTION DETAILS =========== -->
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="details">
  <th colspan="2">Function Details</th></tr>
</table>

<a name="assertion"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">assertion</span>(<span class=sig-arg>test</span>,
          <span class=sig-arg>message</span>)</span>
  </h3>
  if test is not true throw
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>test</b></code> -
         test to assert on
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=bool)</i>
      <dd><code><b>message</b></code> -
         to display on error
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=string)</i>
      </dd>
    </dl>
    <dl><dt><b>Raises:</b></dt>
      <dd><code><b>exceptions.AssertionError</b></code> -
        if test == False
    </dl>
  </dd></dl>
</td></tr></table>

<a name="out"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">out</span>(<span class=sig-arg>s</span>,
          <span class=sig-arg>level</span>=<span class=sig-default>0</span>)</span>
  </h3>
  print to standard out and log
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="setLogLevel"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">setLogLevel</span>(<span class=sig-arg>level</span>)</span>
  </h3>
  level 0 -&gt; always print. level 2 -&gt; print only in debug
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="setLogMode"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">setLogMode</span>(<span class=sig-arg>mode</span>)</span>
  </h3>
  set the global log mode
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="stringify"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">stringify</span>(<span class=sig-arg>value</span>,
          <span class=sig-arg>defaultIfNull</span>=<span class=sig-default>''</span>)</span>
  </h3>
  attempt to convert string. returns defaultIfNull if null
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        string
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="toInt"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">toInt</span>(<span class=sig-arg>value</span>)</span>
  </h3>
  attempt to convert string to int. returns 0 if it is not 
  possible
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        int
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>
<br />


<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="center">
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar" align="right" width="100%">
      <table border="0" cellpadding="0" cellspacing="0">
      <tr><th class="navbar" align="center">
        <p class="nomargin">
          <a class="navbar" target="_top" href="http://code.google.com/p/dps-x509/">DPS</a>
      </p></th></tr></table>
    </th>
  </tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td align="left"><font size="-2">Generated by Epydoc 2.1 on Sun Oct 24 22:24:03 2010</font></td>
    <td align="right"><a href="http://epydoc.sourceforge.net"
                      ><font size="-2">http://epydoc.sf.net</font></a></td>
  </tr>
</table>
</body>
</html>
